<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='护理项目-编辑',cssPaths='/static/css/services/item/add.css',jsPaths='/static/js/services/items/add.js')">
<div class="right" th:fragment="right">
    <!--面包屑-->
    <div class="breadcrumb layui-bg-gray">
                <span class="layui-breadcrumb" lay-separator=">">
                    <a th:href="@{/}">首页</a>
                    <a href="/organization">系统管理</a>
                    <a href="/items">护理项目</a>
                    <a><cite>编辑</cite></a>
                </span>
    </div>

    <!--主体内容区-->
    <div class="form-content layui-container">
        <form class="layui-form" th:action="@{/items/update}" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label must">项目名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" th:value="${items.name}"  maxlength="100"  lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input">
                    <input type="hidden" name="id" th:value="${items.id}">
                </div>
            </div>
            <div class="layui-form-item"  th:if="${nature == 2}">
                <label class="layui-form-label must">项目单价</label>
                <div class="layui-input-inline">
                    <input type="number" name="price"    oninput="if(value.length>10)value=value.slice(0,10)" lay-verify="required" placeholder="请输入单价" th:value="${items.price}" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">单位：元 不收费项目单价请设置为0</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">项目类型</label>
                <div class="layui-input-block">
                    <select name="type" lay-verify="required" lay-filter="itemsType">
                        <option value="1" th:selected="${items.type == 1}">普通项目</option>
                        <option value="2" th:selected="${items.type == 2}">体检项目</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">简介</label>
                <div class="layui-input-block">
                    <textarea name="intro" placeholder="请说明该类别涵盖的服务范围" maxlength="2000" class="layui-textarea" th:text="${items.intro}"></textarea>
                </div>
            </div>
            <div class="layui-row">
                <label class="layui-form-label must">上传图片</label>
                <div class="layui-input-block">
                    <div class="layui-upload">
                        <div class="layui-upload-list">
                            <img class="layui-upload-img" th:src="@{'/storage/files/'+${items.itemImg}}" id="img1">
                            <input type="hidden" maxlength="500" name="itemImg" class="hiddenIpt">
                        </div>
                    </div>
                </div>
            </div>
            <div id="hdibox" th:style="'display:' + @{(${items.type != 2} ? 'none' : 'block')} + ''">
                <blockquote class="layui-elem-quote layui-quote-nm" style="color:orangered;font-size: 18px;">请选择该体检项目所能产生的健康数据</blockquote>
                <div class="healthDataItems">
                    <div class="healthDataItemsBox" th:if="${healthDataItemsMap}" th:each="entry:${healthDataItemsMap}">
                        <p class="leibie"  th:text="${entry.key }"></p>
                        <input type="checkbox" name="healthDataItemId" th:each="v:${entry.value}" th:value="${v.id}" th:title="${v.name}" th:checked="${#lists.contains(healthDataItemIds,v.id)}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn  layui-btn-normal" lay-submit lay-filter="submitBtn">保存</button>
                    <a href="/items" class="layui-btn layui-btn-primary">返回</a>
                </div>
            </div>
        </form>

    </div>
</div>
</html>